import { instance } from '@/plugins'

export const balance = () => {
  return instance({
    url: '/trade/balance',
    method: 'GET'
  })
}

export const swap = (value: number) => {
  return instance({
    url: '/trade/swap',
    method: 'POST',
    data: {
      value
    }
  })
}

export const withdraw = (amount: number) => {
  return instance({
    url: '/trade/withdraw',
    method: 'POST',
    data: {
      amount
    }
  })
}

export const record = () => {
  return instance({
    url: '/trade/record',
    method: 'GET'
  })
}
